package com.dwd.hrm.client;

import com.dwd.hrm.doc.CourseDoc;
import com.dwd.hrm.query.CourseDocQuery;
import com.dwd.hrm.util.AjaxResult;
import com.dwd.hrm.util.PageList;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description: TODO
 * @Author 汶狄
 * @Date 2021/3/8 15:50
 * @Version 1.0
 */
@FeignClient(value = "HRM-SEARCH", fallbackFactory = CourseFallbackFactory.class)
@RequestMapping("/esSearch")
public interface CourseDocClient {
    @PostMapping("/addOrUpdate")
    AjaxResult addOrUpdate(@RequestBody CourseDoc courseDoc);

    @DeleteMapping("/delete/{id}")
    AjaxResult deleteCourse(@PathVariable("id") Long id);

    @PostMapping("/addAll")
    AjaxResult addAll(@RequestBody List<CourseDoc> courseDocs);

    @PostMapping("/queryCourses")
    PageList<CourseDoc> queryCourses(@RequestBody CourseDocQuery courseDocQuery);
}
